import java.util.*;
public class task4 {

	public static void main(String[] args) {

		double z , total = 0 , area;
		int i, size;
		
		Scanner sc= new Scanner(System.in);
		
		do{
			System.out.print("Enter number of distinct corners for the polygon: ");
			size = sc.nextInt();

			if(size<3)
			System.out.println("Error: invalid input");
			}while(size<3);
		
		
		double[] x = new double[size+1];
		double[] y = new double[size+1];
		
		
		for(i=0 ; i<size ; i++)
		{
			System.out.printf("Enter the x and y coordinates of corner#%d",i+1);
			x[i] = sc.nextDouble();
			y[i] = sc.nextDouble();
		}
		
		x[size] = x[0];
		y[size] = y[0];
		
		for(i=0 ; i<x.length-1 ; i++)
		{
			z = (x[i+1]+x[i])*(y[i+1]-y[i]);
			total = total + z;
		}
		area = (1/2.0) * Math.abs(total);
		
		System.out.printf("%nPolygon area = %f sqr meters",area);
		
		sc.close();

	}

}
